package org.taglets.pub;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.protocol.Protocol;
import org.taglets.ssl.EasySSLProtocolSocketFactory;

import java.io.IOException;
import java.io.InputStream;

/**
 * User: petrovic
 * Date: Feb 21, 2009
 * Time: 3:52:09 PM
 */
/*
// Example of how the client actually works with Apache Commons client
public class Main {
    public static void main(String args[]) {
        Protocol https = new Protocol("https", new EasySSLProtocolSocketFactory(), 443);
        HttpClient client = new HttpClient();
        client.getHostConfiguration().setHost("api.taglets.org", 443, https);
        
        GetMethod method = new GetMethod("/tag/retrieve/taglets");
        try {
            int statusCode = client.executeMethod(method);
            String body = method.getResponseBodyAsString();
            System.out.printf("body: %s\n", body);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
*/
